package com.lktx.sso.admin.entity;

import com.mybatisflex.annotation.*;
import lombok.Data;

import java.time.LocalDateTime;

/** 用户组关系映射表 - sso_user_group_mapping */
@Data
@Table("sso_user_group_mapping")
public class SsoUserGroupMapping {
    /**主键ID*/
    @Id(value = "id", keyType = KeyType.Auto)
    private Integer id;
    /**用户ID*/
    private Integer ssoUserId;
    /**用户组ID*/
    private Integer ssoUserGroupId;
    /**创建时间*/
    @Column(onInsertValue = "now()")
    private LocalDateTime createTime;

    @RelationOneToOne(selfField = "ssoUserId", targetField = "ssoUserId")
    private SsoUser ssoUser;

    @RelationOneToOne(selfField = "ssoUserGroupId", targetField = "ssoUserGroupId")
    private SsoUserGroup ssoUserGroup;
}